/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.worlds.object;

import net.worlds.WorldsException;


public class Teams extends GameObject{
    public Teams() throws WorldsException
    {
        super("Teams");
    }
    @Override
    public void addChild(GameObject c) throws WorldsException
    {
        super.addChild(c);
        if(c instanceof Team && world == world.game.getMainWorld())
            world.game.addTeam(((Team)c));
    }
    @Override
    public void removeChild(GameObject c)
    {
        super.removeChild(c);
        if(c instanceof Team && world == world.game.getMainWorld())
            world.game.removeTeam(((Team)c).toString());
    }
}
